<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo ($title); ?></title>
    <meta name="keywords" content="<?php echo ($title); ?>">
    <meta name="description" content="<?php echo ($title); ?>">

    <link rel="shortcut icon" href="favicon.ico"> <link href="/Public/static/admin/css/bootstrap.min14ed.css" rel="stylesheet">
    <link href="/Public/static/admin/css/font-awesome.min93e3.css" rel="stylesheet">

    <!-- Data Tables -->
    <link href="/Public/static/admin/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="/Public/static/admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/static/admin/css/style.min.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>文章表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-2">
                            <div class="input-group">
                                <a href="<?php echo U('add');?>" class="btn btn-outline btn-primary ">添加文章</a>
                            </div>
                        </div>
                        <form name="admin_list" id="admin_list" action="<?php echo U();?>" method="post">
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入关键词" class="input-sm form-control" name="word" id="word" value="<?php echo ($word); ?>">
                                        <span class="input-group-btn">
                                            <button type="submit" class="btn btn-sm btn-primary">搜 索</button>
                                        </span>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="hr-line-dashed" style="margin: 10px"></div>
                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>文章ID</th>
                            <th>标题</th>
                            <th>所属分类</th>
                            <th>添加时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><tr class="gradeA">
                                <td><?php echo ($v["id"]); ?></td>
                                <td><?php echo ($v["title"]); ?></td>
                                <td><?php echo ($v["category"]); ?></td>
                                <th class="center"><?php echo (date('Y-m-d H:i',$v['add_time'])); ?></th>
                                <td><a href="javascript:;" class="btn btn-primary btn-xs" onclick="edit(<?php echo ($v["id"]); ?>)"><i class="fa fa-edit"></i> 编辑</a>&nbsp;&nbsp;
                                    <a href="javascript:;" class="btn btn-danger btn-xs" onclick="del(<?php echo ($v["id"]); ?>)"><i class="fa fa-trash-o"></i> 删除</a></td>
                            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                        </tbody>
                    </table>
                    <?php echo ($page); ?>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="/Public/static/admin/js/jquery.min.js"></script>
<script src="/Public/static/admin/js/bootstrap.min.js"></script>
<script src="/Public/static/admin/js/plugins/jeditable/jquery.jeditable.js"></script>
<script src="/Public/static/admin/js/common.js"></script>
<script src="/Public/static/public/layui/lay/dest/layui.all.js"></script>
<!-- 自定义js -->
<script src="/Public/static/admin/js/content.min.js"></script>
<script>
    function  del(id){
        sxshop.del(id,"<?php echo U('del');?>","<?php echo U();?>");
    }
    function edit(id){
        location.href='/admin/Article/edit/id/'+id+'.html';
    }
</script>

</body>

</html>